package com.sskj.b70.p.activity;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.b70.m.bean.CommissionBean;
import com.sskj.b70.m.bean.HaiPageBean;
import com.sskj.b70.m.bean.HttpData;
import com.sskj.b70.m.http.JsonConverter;
import com.sskj.b70.p.base.BasePresenter;
import com.sskj.b70.v.activity.CommissionDetailActivity;

import java.util.List;

import io.reactivex.Flowable;

public class CommissionDetailsPresenter extends BasePresenter<CommissionDetailActivity> {
    public Flowable<List<CommissionBean>> loadData(int page, String dateFrom, String dateTo) {

        return httpService.agentMoneyDetail(page, dateFrom, dateTo)
                .converter(new JsonConverter<HttpData<HaiPageBean<CommissionBean>>>() {
                })
                .adapt(new FlowableBody<>())
                .map(listHttpData -> listHttpData.getData().getRes());

    }
}
